<template>
  <view class="invoice-apply-detail">
    <view class="tab-box">
      <view class="tab-active">
        <text>基本信息</text>
        <text style="width: 40px;
        height: 2px;
        background: #dc2734;margin-top:-2px"></text>
      </view>
      <view class="tab-default">
        <text>物料信息</text>
        <text></text>
      </view>
    </view>
    <!-- <view>
      <view>
        <view class="top">
          <text>申请单号</text>
          <view>
            <view class="number">
              <text>100182627</text>
              <text>普通开票</text>
            </view>
            <text>待提交</text>
          </view>
        </view>
        <view>
          <view>
            <text>发票类型:</text>
            <text>我是内容</text>
          </view>
          <view>
            <text>申请日期:</text>
            <text>我是内容</text>
          </view>
          <view>
            <text>开票日期:</text>
            <text>我是内容</text>
          </view>
          <view>
            <text>开票机构:</text>
            <text>我是内容</text>
          </view>
          <view>
            <text>创建人:</text>
            <text>我是内容</text>
          </view>
          <view>
            <text>总金额:</text>
            <text>我是内容</text>
          </view>
        </view>
        <view>
          <text>编辑</text>
          <text>提交</text>
          <text>查看</text>
        </view>
      </view> 
    </view>-->
    <view class="handle-box">
      <view class="handle-default" @click="() => {
          dialogTextareaShow = true;
        }">审核拒绝</view>
      <view class="handle-red" @click="() => {
          dialogShow = true;
        }">审核通过</view>
    </view>
    <yh_dialog
      v-model="dialogShow"
      hint="请确认是否通过审核？"
      sureText="确认通过"
      :handleCancel="
        () => {
          dialogShow = false;
        }
      "
      :handleSure="handleDialogSure"
    />
    <yh_dialog_textarea
      v-model="dialogTextareaShow"
      hint="请填写审核拒绝意见"
      placeholder='请填写拒绝原因～'
      sureText="审核拒绝"
      :handleCancel="
        () => {
          dialogTextareaShow = false;
        }
      "
      :handleSure="handleDialogTextareaSure"
    />
  </view>
</template>

<script lang="ts">
import { reactive, toRefs,ref } from "vue";
import yh_dialog from "@/components/yh-dialog.vue";
import yh_dialog_textarea from "@/components/yh-dialog-textarea.vue";

export default {
  name: "invoice-apply-detail",
  components: {yh_dialog, yh_dialog_textarea},
  setup() {
    const state = reactive({
      dialogShow: false,
      dialogTextareaShow: false,
      textAreaContent: "",
    });
    const value = ref("");
    const handleDialogSure = () => {
      state.dialogShow = false;
    };
    const handleDialogTextareaSure = (value) => {
      console.log("qwerwqwewe");
      state.textAreaContent = value;
      console.log(value);
      state.dialogTextareaShow = false;
      console.log(state.textAreaContent);
    };
    return {
      value,
      handleDialogSure,
      handleDialogTextareaSure,
      ...toRefs(state),
    };
  },
};
</script>

<style lang="scss">
.invoice-apply-detail {
  width: 100%;
  background: #f4f4f4;
  display: flex;
  flex-direction: column;
  align-items: center;
  .tab-box {
    width: calc(100% - 24px);
    background: #ffffff;
    height: 44px;
    display: flex;
    margin: 8px 12px;
    flex-direction: row;
    align-items: center;
    .tab-active {
      display: flex;
      height: 44px;
      flex-direction: column;
      align-items: center;
      flex: 1;
      font-size: 14px;
      font-family: PingFangSC, PingFangSC-Medium;
      font-weight: 500;
      color: #dc2734;
      line-height: 44px;
      .active-line {
        width: 40px;
        height: 2px;
        background: #dc2734;
        margin-top: -2px;
      }
    }
    .tab-default {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      flex: 1;
      font-size: 14px;
      font-family: PingFangSC, PingFangSC-Regular;
      font-weight: 400;
      color: #333333;
      line-height: 20px;
    }
  }
  .list {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    .cell {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      width: 100%;
      background: #ffffff;
      .top {
        display: flex;
        flex-direction: column;
        width: 100%;
        border-bottom: 1px solid #eeeeee;
        .label {
          font-size: 10px;
          font-family: PingFangSC, PingFangSC-Regular;
          font-weight: 400;
          text-align: left;
          color: #999999;
          line-height: 18px;
        }
        .number-state {
          display: flex;
          flex-direction: row;
          justify-content: space-between;
          align-items: center;
          .number-tab {
            display: flex;
            flex-direction: row;
            align-items: center;
            .number {
              font-size: 13px;
              font-family: PingFangSC, PingFangSC-Medium;
              font-weight: 500;
              text-align: left;
              color: #262626;
              line-height: 18px;
            }
            .tab {
              width: 48px;
              height: 16px;
              opacity: 0.5;
              border: 1px solid #464557;
              border-radius: 1px;
            }
          }
        }
        .state {
          font-size: 12px;
          font-family: PingFangSC, PingFangSC-Regular;
          font-weight: 400;
          text-align: right;
          color: #dc2734;
          line-height: 18px;
        }
      }
      .middle {
        display: flex;
        flex-direction: column;
        padding: 6px 16px;
        &-content {
          display: flex;
          flex-direction: row;
          padding: 4px 0;
          .label {
            font-size: 12px;
            font-family: PingFangSC, PingFangSC-Regular;
            font-weight: 400;
            color: #999999;
            line-height: 17px;
          }
          .content {
            font-size: 12px;
            font-family: PingFangSC, PingFangSC-Regular;
            font-weight: 400;
            color: #666666;
            line-height: 17px;
          }
        }
      }
      .bottom {
        display: flex;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        padding: 8px 16px 16px;
        .btn {
          width: 72px;
          height: 28px;
          opacity: 1;
          border: 1px solid #999999;
          border-radius: 2px;
          font-size: 13px;
          font-family: PingFangSC, PingFangSC-Regular;
          font-weight: 400;
          color: #333333;
          line-height: 18px;
          display: flex;
          justify-content: center;
          align-items: center;
          margin-left: 8px;
        }
      }
    }
  }
  .handle-box{
    width: calc(100% - 32px);
    position: fixed;
    bottom: 0;
    padding: 16px 16px 36px;
    background: #ffffff;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    .handle-default{
      width: 72px;
      height: 28px;
      border: 1px solid #999999;
      border-radius: 2px;
      font-size: 13px;
      font-family: PingFangSC, PingFangSC-Regular;
      font-weight: 400;
      color: #333333;
      line-height: 18px;
      display: flex;
      justify-content: center;
      align-items: center;
      margin-left: 8px;
    }
    .handle-red{
      width: 72px;
      height: 28px;
      border: 1px solid #DC2734;
      border-radius: 2px;
      font-size: 13px;
      font-family: PingFangSC, PingFangSC-Regular;
      font-weight: 400;
      color: #DC2734;
      line-height: 18px;
      display: flex;
      justify-content: center;
      align-items: center;
      margin-left: 8px;
    }
  }
}
</style>